<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />  
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<title>系统登录</title>
<link href="images/login/style.css" rel="stylesheet" type="text/css" />
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<%@include file="/styles/css_lib.jsp"%>
<%@include file="/pages/common/js_global.jsp"%>
<%@include file="/scripts/sdk/js_lib.jsp"%>
<%@include file="/scripts/config/js_lib.jsp" %>
<%@include file="/scripts/utils/js_lib.jsp"%>

<script>
function pageOnLoad(){
	try{
		if(window.parent != window){ 
			top.document.location.href = document.location.href;   
        }else{
        	initJS();
        }
	}catch(e){
	}   
}

function login(){
	TB_showMaskLayer("登录中...请稍候");
	var userName = document.getElementById("userName").value;
	var password = document.getElementById("password").value;
	
	LoginService.login(userName, password, function(data){
		if(data != null && typeof(data) == "object"){
			window.location = 'index.jsp';
			TB_removeMaskLayer();
		}else{
			//alert(data);			
			TB_removeMaskLayer();
			alert('您输入的用户名或密码有误！');			
		}
	});
}

function clearForm(){
	document.getElementById("userName").value = '';
	document.getElementById("password").value = '';
}

function onKeyUpLogin(e){
    var intKey = window.event ? event.keyCode : e.keyCode;
	if(intKey == 13){
		login();
	}
}
function initJS(){
	document.getElementById("loadIfr").src="index_pre_load.jsp";
}
</script>

</head>
<body class="LoginDiv" onload="pageOnLoad();" scroll="no">
<center>
  <div>
    <div class="LoginLogo"></div>
    <div id="LoginBox">
      <div class="Top"></div>
	  <div class="Content">
	    <div class="Left"></div>
		<div class="Center">
		  <div class="FloatLeft"><img src="images/login/LoginImg.png" width="151" height="183" /></div>
		  <div class="FloatLeft">
		    <form id="form1" name="form1" method="post" action="">
		      <table width="240" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="59" height="30">&nbsp;</td>
                  <td width="181">&nbsp;</td>
                </tr>
                <tr>
                  <td height="30">用户名：</td>
                  <td align="left">
                    <input type="text" id="userName" name="userName" size="16" maxlength="20" value="admin"/>
                  </td>
                </tr>
                <tr>
                  <td height="30">密&nbsp;码：</td>
                  <td align="left">
                    <input type="password" id="password" name="password" size="16" onkeyup="onKeyUpLogin(event)" maxlength="20" value="admin"/>
                  </td>
                </tr>
                <tr>
                  <td height="60" colspan="2" valign="bottom">
                  	  <input type='button' class="button_loginHTML" onclick="login()" style="cursor:pointer;"/>
                  	  <input type='reset' class="button_loginResetHTML" onclick="clearForm()" value="" style="cursor:pointer;"/>
                  </td>
                </tr>
              </table>
            </form>
	      </div>
		</div>
		<div class="right"></div>
	  </div>
	  <div class="Bottom"></div>
    </div>
	<div id="LoginBottom">地址：厦门火炬高新区软件园二期望海路29号吉联大厦<br />
邮编：361000  电话：0592-2577999  传真：0592-2577999<br />
CopyRight &copy; 2003-2010 Gillion Technologies Ltd. All Rights Reserved
</div>
  </div>
</center>
<iframe id="loadIfr" src="" width="0" height="0" frameborder="0"></iframe>
</body>
</html>
